#ifndef __alarm_H
#define __alarm_H
#include "stm32l1xx_hal.h"

extern RTC_HandleTypeDef hrtc;
extern void _Error_Handler(char *, int);

typedef struct _time_date{
	RTC_TimeTypeDef rtctime;
	RTC_DateTypeDef rtcdate;
}time_date;
void RTC_Init(void);
void set_Time(int h,int m,int s);
void set_Date(int y,int m,int w,int d);

void get_Time(RTC_TimeTypeDef* Time);
void get_Date(RTC_DateTypeDef* Date);
void set_Alarm_Seconds(uint32_t sec);
#define set_wakeup_time(wakeup_time) HAL_RTCEx_SetWakeUpTimer_IT(&hrtc,wakeup_time, RTC_WAKEUPCLOCK_CK_SPRE_16BITS)	

#endif